#ifndef SEMA_H
#define SEMA_H

#include "Lock.h"
#include "Condition.h"

class Sema {
 public:
  Sema(int initialValue = 1);
  void wait();
  void post();
  int getValue();

 private:
  int mValue;
  Lock mLock;
  Condition mCondition;
};

#endif
